package com.bingxue.edu.management.system.model.entity;

import com.bingxue.edu.common.enums.RunStatusEnum;
import com.bingxue.edu.framework.common.model.BaseEntity;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 定时任务日志实体
 *
 * @author panbo
 * @since 2024/08/02 13:34
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Table("base_schedule_job_log")
public class ScheduleJobLog extends BaseEntity {

    /**
     * 任务id
     */
    private String jobId;

    /**
     * 任务名称
     */
    private String jobName;

    /**
     * 定时表达式
     */
    private String cron;

    /**
     * 参数
     */
    @Column(isLarge = true)
    private String paramJson;

    /**
     * 开始时间
     */
    private LocalDateTime startTime;

    /**
     * 结束时间
     */
    private LocalDateTime endTime;

    /**
     * 耗时(s)
     */
    private Integer elapsedSeconds;

    /**
     * 运行状态
     */
    private RunStatusEnum runStatus;

    /**
     * 数据计数
     */
    private Integer dataCount;

    /**
     * 执行结果信息
     */
    @Column(isLarge = true)
    private String resultMessage;
}
